Skip to content

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

jyn514 and others added 11 commits June 6, 2020 17:09
When creating default values a trait method needs to be called with an
explicit trait name.  `Default::default()` seems redundant.  A free
function on the other hand, when imported directly, seems to be a better
API, as it is just `default()`.  When implementing the trait, a method
is still required.
I wasn't aware items _could_ be fake, so I think having a function
mentioning it could be helpful. Also, I'd need to make this change for
cross-crate intra-doc links anyway, so I figured it's better to make the
refactor separate.
…ts` query

This is to avoid the final conversion from `NodeId` to `HirId`
during call to `Resolver::(clone|into)_outputs`.
Free `default()` forwarding to `Default::default()`

It feels a bit redundant to have to say `Default::default()` every time I need a new value of a type that has a `Default` instance.
Especially so, compared to Haskell, where the same functionality is called `def`.
Providing a free `default()` function that forwards to `Default::default()` seems to improve the situation.
The trait is still there, so if someone wants to be explicit and to say `Default::default()` - it still works, but if imported as `std::default::default;`, then the free function reduces typing and visual noise.
…def-id, r=petrochenkov

Use `LocalDefId` directly in `Resolver::export_map`

This is to avoid the final conversion from `NodeId` to `HirId`
during call to `(clone|into)_outputs`

This brings down the post-lowering uses of `NodeId` down to 2 calls to convert the `trait_map`.

cc rust-lang#50928

r? @petrochenkov
…Gomez

Add Item::is_fake for rustdoc

I wasn't aware items _could_ be fake, so I think having a function
mentioning it could be helpful. Also, I'd need to make this change for
cross-crate intra-doc links anyway, so I figured it's better to make the
refactor separate.
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 7, 2020

📌 Commit b8f453f has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 7, 2020
@bors
Copy link
Collaborator

bors commented Jun 8, 2020

⌛ Testing commit b8f453f with merge d755462bc5e7d30cf1d58bcf8630d3a11c3376e8...

@bors
Copy link
Collaborator

bors commented Jun 8, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 8, 2020
@Dylan-DPC-zz
Copy link
Author

this was spurious..

closing

@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-hlvua61 branch June 8, 2020 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants